<h1>Product</h1>
<p>当前的pid: <%= locals.pid %></p>

<a href="/">返回</a>
<a href="#" onclick="trackPageView()">触发目标</a>
<br/>
<a href="#" onclick="trackGoal()">触发目标</a>
<a href="#" onclick="trackGoal1()">触发目标1</a>

<iframe width="100%" height="600px" src="http://www.agoodme.com/#/"></iframe>
<script type="text/javascript">
    var pid = <%= locals.pid || 2001 %>;
    var puid = pid;
    window._product = {
        id: pid,  //作品ID
        uid: puid  //作品所属用户ID，即作者
    };

    function trackGoal(){
        new MeAnalytics().trackGoal(1, 'fav', 'user');
        alert('OK');
    }

    function trackGoal1(){
        new MeAnalytics().trackGoal(3, 'fav', 'user', 10011, pid, 20011);
        alert('OK');
    }

    function trackPageView(){
        new MeAnalytics().trackPageView(window._user.id, window._product.id, window._product.uid);
    }
</script>